import moment from "moment";

import { config } from "@src/config";

export const isDate = (parameter: any): boolean => {
  return new Date(parameter).getTime() > 0;
};

export const isIntegerHour = (parameter: any): boolean => {
  if (!Number.isInteger(parameter)) {
    return false;
  }

  const time = moment.utc(parameter).utcOffset(config.timezoneOffset);

  return (
    time.minutes() === 0 && time.seconds() === 0 && time.milliseconds() === 0
  );
};
